#include<iostream>
#include<string>
using namespace std;
class person{
	private:
		int ID;
		string Name;
	public:
		person(int id,string name):ID(id),Name(name){};
		void display()const{
			cout<<"ID:"<<ID<<"\n"<<"Name:"<<Name<<endl;
		}
};
class student:public person{
	private:
		string Class;
		double grade;
	public:
		student(int id,string name,string cls,double grd):person(id,name),Class(cls),grade(grd) {}
	void input(){
        cout <<"请输入班级: ";  
        cin>>Class;
        cout <<"请输入成绩: ";  
        cin>>grade;  
    }
    void display()const{  
        person::display();
        cout<<"Class: "<<Class<<"\n"<<"Grade: " <<grade<<endl;  
    }
};
class teacher:public person{
	private:
		string title;
		string department;
	public:
		teacher(int id,string name,string ttl,string dept):person(id,name),title(ttl),department(dept) {}
	void input(){
		cout<<"请输入职称:";
		cin>>title;
		cout<<"请输入部门:";
		cin>>department;
	}
	void display()const{
		person::display();
		cout<<"title: "<<title<<"\n"<<"department: "<<department<<endl;
	}
};
int main() {   
    int studentID, teacherID;  
    string studentName, teacherName, studentClass, teacherTitle, teacherDept;  
    double studentGrade;  
    cout << "请输入学生的ID和姓名: ";  
    cin >> studentID >> studentName;  
    cout << "请输入学生的班级和成绩: ";  
    cin >> studentClass >> studentGrade;
	  
    student student1(studentID, studentName, studentClass, studentGrade); 
	 
    cout << "学生信息:" << endl;  
    student1.display();
    cout << endl;  
    cout << "请输入教师的ID和姓名: ";  
    cin >> teacherID >> teacherName;  
    cout << "请输入教师的职称和部门: ";  
    cin >> teacherTitle >> teacherDept;  
    
    teacher teacher1(teacherID, teacherName, teacherTitle, teacherDept);  
    
    cout << "教师信息:" << endl;  
    teacher1.display();
    return 0;  
}